<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<link rel="stylesheet" type="text/css" href="/css/Style.css" />

<fmt:setBundle basename="messages" />
<title> <fmt:message key="title"/> </title>
</head>
<body>
<!--Test-->
<%@ include file="Header.jsp"%>
<table align="center"  width="100%" cellspacing="2" cellpadding="1" border="0" >
<tr>
<td style="vertical-align: top;"><%@ include file="Menu.jsp"%></td>
<td>
<h3><fmt:message key="label.employee"/></h3>
        <c:url var="url" scope="page" value="/AdminAdd.jsp">
        		<c:param name="name" value=""/>                
                <c:param name="insert" value="true"/>
        </c:url>
        <a href="${url}"><fmt:message key="label.employee.add"/></a>
        <br/><br/>
        <table class="borderAll" cellpadding="10" cellspacing="10"> 
       
               	
            <tr>
               <th>#</th>
                <th><fmt:message key="label.employee.name"/></th>       
                <th><fmt:message key="label.employee.employeeRank"></fmt:message></th>         
                <th><fmt:message key="label.employee.edit"/> <fmt:message key="label.employee.delete"/></th>
            </tr>
            <c:forEach var="employee" items="${employee}" varStatus="status">
                <tr class="${status.index%2==0?'even':'odd'}">
                     <td class="nowrap">${status.index + 1}</td>
                    <td class="nowrap">${employee.name}</td>
                    <td class="nowrap">${employee.employeeRank}</td>                    
                    <td class="nowrap">
                        <c:url var="updurl" scope="page" value="/AdminUpdateServlet">
                        <c:param name="empid" value="${employee.employeeId}"/>>
                            <c:param name="name" value="${employee.name}"/>
                            <c:param name="employeeRank" value="${employee.employeeRank}"/>
                            <c:param name="update" value="true"/>
                        </c:url>
                        <a href="${updurl}"><fmt:message key="label.employee.edit"/></a>
                        &nbsp;&nbsp;&nbsp;
                        <c:url var="delurl" scope="page" value="/AdminDelete">
                            <c:param name="empid" value="${employee.employeeId}"/>
                        </c:url>
                        <a href="${delurl}"><fmt:message key="label.employee.delete"/></a>
                    </td>
                </tr>
            </c:forEach>
            
         </table>
         </td>
         </tr>
         </table>
</body>
</html>